package main

import (
	"github.com/pkg/errors"
	"github.com/spf13/cobra"
)

type imageOptions struct {
	image string
	test  string
}

var imageOpts imageOptions

// NewRunCmd returns run command
func newImageCmd() *cobra.Command {
	imageCmd := &cobra.Command{
		Use:     "image [FLAGS]",
		Short:   "generate image require spec",
		Example: `flower image --image "docker.io/library/nginx" --test "docker.io/library/nginx-test"`,
		RunE:    imageCommand,
	}

	imageCmd.PersistentFlags().StringVarP(&imageOpts.image, "image", "i", "", "business image")
	imageCmd.PersistentFlags().StringVarP(&imageOpts.test, "test", "t", "", "business test image")

	return imageCmd
}

func imageCommand(c *cobra.Command, args []string) error {
	if len(args) != 0 {
		return errors.New("no arguments needed here, please use flags")
	}

	return nil
}
